/*
  Copyright 1996-2003
  Simon Whiteside

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


* $Id: StatementStepper.java,v 1.6 2003/03/14 19:53:12 simkin_cvs Exp $
*/

package simkin;
import java.util.Hashtable;

/**
 * This interface is implemented by objects which are called by the Interpreter when statements are executed
 */
public interface StatementStepper {
    /** This method is called each time a statement is executed by the interpreter, just before the statement is performed
     * @return false to halt the execution of the current method
     * @param frame the current stack frame
     * @param statement_type an integer indicating the type of statement, a constant s_ value from the ParseNode class
     */
    boolean statementExecuted(StackFrame frame,int statement_type);
    /** This method is called each time a compound statement is executed by the interpreter, just before the statement is performed
     * @return false to halt the execution of the current method
     * @param frame the current stack frame
     */
    boolean compoundStatementExecuted(StackFrame frame);
    /**
     * This method is called if an exception is encountered while executing a script.
     * @param frame the current stack frame
     * @param e the exception that has occurred
     * @param desc the exception description without location information
     * @return true to throw the exception, false to ignore and continue
     */
    boolean exceptionEncountered(StackFrame frame,Exception e,String desc);
    /**
     * This method is called if the interpreter encounters a breakpoint command.
     * @param frame the current stack frame
     */
    void breakpoint(StackFrame frame);
}
